home *** CD-ROM | disk | FTP | other *** search
/ VRML 2.0 Sourcebook (2nd Edition) / VRML 2.0 Sourcebook CD [md5 fed90f4f9c39d5a60d477058775c7e21].iso / book / win / ch10 / 10fig09.wrl < prev    next >
Text File  |  1996-09-23  |  2KB  |  81 lines

  1. #VRML V2.0 utf8
  2. # The VRML 2.0 Sourcebook
  3. # Copyright 1997 By
  4. # Andrea L. Ames, David R. Nadeau, and John L. Moreland
  5. Group {
  6.     children [
  7.     # Blinking balls
  8.         Transform {
  9.             translation -2.0 0.0 0.0
  10.             children Shape {
  11.                 appearance Appearance {
  12.                     material DEF Ball1Color Material {
  13.                         diffuseColor 0.4 0.4 0.4
  14.                     }
  15.                 }
  16.                 geometry DEF ABall Sphere { }
  17.             }
  18.         },
  19.         Shape {
  20.             appearance Appearance {
  21.                 material DEF Ball2Color Material {
  22.                     diffuseColor 0.4 0.4 0.4
  23.                 }
  24.             }
  25.             geometry USE ABall
  26.         },
  27.         Transform {
  28.             translation  2.0 0.0 0.0
  29.             children Shape {
  30.                 appearance Appearance {
  31.                     material DEF Ball3Color Material {
  32.                         diffuseColor 0.4 0.4 0.4
  33.                     }
  34.                 }
  35.                 geometry USE ABall
  36.             }
  37.         },
  38.     # Animation clocks
  39.         DEF Clock1 TimeSensor {
  40.             cycleInterval 1.0
  41.             loop TRUE
  42.         },
  43.         DEF Clock2 TimeSensor {
  44.             cycleInterval 1.3
  45.             loop TRUE
  46.         },
  47.         DEF Clock3 TimeSensor {
  48.             cycleInterval 0.7
  49.             loop TRUE
  50.         },
  51.     # Animation paths
  52.         DEF Color1Path ColorInterpolator {
  53.             key [ 0.0, 0.5, 0.5, 1.0 ]
  54.             keyValue [
  55.                 1.0 1.0 0.0,  1.0 1.0 0.0,
  56.                 0.0 1.0 0.0,  0.0 1.0 0.0,
  57.             ]
  58.         },
  59.         DEF Color2Path ColorInterpolator {
  60.             key [ 0.0, 0.5, 0.5, 1.0 ]
  61.             keyValue [
  62.                 0.0 1.0 0.0,  0.0 1.0 0.0,
  63.                 0.0 0.0 1.0,  0.0 0.0 1.0,
  64.             ]
  65.         },
  66.         DEF Color3Path ColorInterpolator {
  67.             key [ 0.0, 0.5, 0.5, 1.0 ]
  68.             keyValue [
  69.                 0.5 0.5 0.5,  0.5 0.5 0.5,
  70.                 1.0 1.0 1.0,  1.0 1.0 1.0,
  71.             ]
  72.         }
  73.     ]
  74. }
  75. ROUTE Clock1.fraction_changed  TO Color1Path.set_fraction
  76. ROUTE Clock2.fraction_changed  TO Color2Path.set_fraction
  77. ROUTE Clock3.fraction_changed  TO Color3Path.set_fraction
  78. ROUTE Color1Path.value_changed TO Ball1Color.set_emissiveColor
  79. ROUTE Color2Path.value_changed TO Ball2Color.set_emissiveColor
  80. ROUTE Color3Path.value_changed TO Ball3Color.set_emissiveColor
  81.